using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using RealState.BusinessObjects;
using RealState.DAL;

namespace RealState.BLL
{
    public class ContentsBLL
    {
        private ContentsDAO _ContentsDAO;

        public ContentsDAO ContentsDAO
        {
            get { return _ContentsDAO; }
            set { _ContentsDAO = value; }
        }

        public ContentsBLL()
        {
            ContentsDAO = new ContentsDAO();
        }

        public List<Contents> GetContentsALL()
        {
            try
            {
                return ContentsDAO.GetContentAll();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Contents> GetContentsData(int Id)
        {
            try
            {
                return ContentsDAO.GetContentData(Id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        

        public List<Contents> GetContentss()
        {
            try
            {
                return ContentsDAO.GetContentss();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public Contents GetContents(int Id)
        {
            try
            {
                return ContentsDAO.GetContents(Id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int AddContents(Contents oContents)
        {
            try
            {
                return ContentsDAO.AddContents(oContents);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int UpdateContents(Contents oContents)
        {
            try
            {
                return ContentsDAO.UpdateContents(oContents);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int UpdateContentsCode(Contents oContents)
        {
            try
            {
                return ContentsDAO.UpdateContentsCode(oContents);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int RemoveContents(Contents oContents)
        {
            try
            {
                return ContentsDAO.RemoveContents(oContents);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int RemoveContents(int Id)
        {
            try
            {
                return ContentsDAO.RemoveContents(Id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List<Contents> DeserializeContentss(string Path)
        {
            try
            {
                return GenericXmlSerializer<List<Contents>>.Deserialize(Path);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void SerializeContentss(string Path, List<Contents> Contentss)
        {
            try
            {
                GenericXmlSerializer<List<Contents>>.Serialize(Contentss, Path);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
